package com.woniuxy.empserver.servcie;

import com.woniuxy.empserver.entity.TManager;
import com.woniuxy.empserver.mapper.TManagerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

@Service
public class ManagerService {
    @Autowired
    TManagerMapper managerMapper ;
    public TManager login(String username) {
       // return managerMapper.selectTManagerByUsername(username);
        Example example = new Example(TManager.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("username",username); // 第一个参数 是 对象的属性
        //  where username = #{value}
        TManager manager = managerMapper.selectOneByExample(example);
        return manager ;
    }
}
